// 接班详情
const takeoverInfo = {
  namespaced: true,
  state: {
    takeoverDetail: null,
    handoverDetail: null,
  },

  mutations: {
    // 保存 接班详情 详情数据
    SET_TAKEOVERDETAIL(state, object) {
      state.takeoverDetail = object;
    },
    // 更新 接班详情 生产任务单数据
    SET_TAKEOVER_ORDERDOTS(state, object) {
      if (state.takeoverDetail) {
        state.takeoverDetail.orderDtos = object;
      }
    },
    // 更新 接班详情 人员安排数据
    SET_TAKEOVER_WORKSTATIONUSERVOS(state, object) {
      if (state.takeoverDetail) {
        state.takeoverDetail.workStationUserVos = object;
      }
    },
    // 保存 交班详情 详情数据
    SET_HANDOVERDETAIL(state, object) {
      state.handoverDetail = object;
    },
    // 更新 交班详情 生产任务单数据
    SET_HANDOVER_ORDERDOTS(state, object) {
      if (state.handoverDetail) {
        state.handoverDetail.orderDtos = object;
      }
    },
    // 更新 交班详情 物料汇总数据
    SET_HANDOVER_LOGMATERIALDOTS(state, object) {
      if (state.handoverDetail) {
        state.handoverDetail.logMaterialDtos = object;
      }
    },
    // 更新 交班详情 人员安排数据
    SET_HANDOVER_WORKSTATIONUSERVOS(state, object) {
      if (state.handoverDetail) {
        state.handoverDetail.workStationUserVos = object;
      }
    },
    // 更新 交班详情 保留到下一班组执行的任务ids
    SET_HANDOVER_REMAINTASKIDS(state, object) {
      if (state.handoverDetail) {
        state.handoverDetail.remainMissionIds = object;
      }
    },
    // 更新 交班详情 不保留到下一班组执行的任务ids
    SET_HANDOVER_ALLTASKIDS(state, object) {
      if (state.handoverDetail) {
        state.handoverDetail.allUndoMissionIds = object;
      }
    },
    // 更新 交班详情 保留到下一班组处理的异常ids
    SET_HANDOVER_REMAINABNORMALIDS(state, object) {
      if (state.handoverDetail) {
        state.handoverDetail.remainAbnormalIds = object;
      }
    },
    // 更新 交班详情 不保留到下一班组处理的异常ids
    SET_HANDOVER_ALLABNORMALIDS(state, object) {
      if (state.handoverDetail) {
        state.handoverDetail.allUndoAbnormalIds = object;
      }
    },
  },

  actions: {},
};

export default takeoverInfo;
